package com.fitns.user.mapper.baseConfig;

import static com.fitns.user.mapper.baseConfig.TbCheckVehicleCarDynamicSqlSupport.*;
import static org.mybatis.dynamic.sql.SqlBuilder.*;

import com.fitns.user.model.baseConfig.TbCheckVehicleCar;

import java.util.List;
import javax.annotation.Generated;

import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
import org.mybatis.dynamic.sql.SqlBuilder;
import org.mybatis.dynamic.sql.delete.DeleteDSL;
import org.mybatis.dynamic.sql.delete.MyBatis3DeleteModelAdapter;
import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider;
import org.mybatis.dynamic.sql.insert.render.InsertStatementProvider;
import org.mybatis.dynamic.sql.render.RenderingStrategy;
import org.mybatis.dynamic.sql.select.MyBatis3SelectModelAdapter;
import org.mybatis.dynamic.sql.select.QueryExpressionDSL;
import org.mybatis.dynamic.sql.select.SelectDSL;
import org.mybatis.dynamic.sql.select.render.SelectStatementProvider;
import org.mybatis.dynamic.sql.update.MyBatis3UpdateModelAdapter;
import org.mybatis.dynamic.sql.update.UpdateDSL;
import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider;
import org.mybatis.dynamic.sql.util.SqlProviderAdapter;

@Mapper
public interface TbCheckVehicleCarMapper {
    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    @SelectProvider(type=SqlProviderAdapter.class, method="select")
    long count(SelectStatementProvider selectStatement);

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    @DeleteProvider(type=SqlProviderAdapter.class, method="delete")
    int delete(DeleteStatementProvider deleteStatement);

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    @InsertProvider(type=SqlProviderAdapter.class, method="insert")
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="record.id", before=false, resultType=Long.class)
    int insert(InsertStatementProvider<TbCheckVehicleCar> insertStatement);

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    @SelectProvider(type=SqlProviderAdapter.class, method="select")
    @ResultMap("TbCheckVehicleCarResult")
    TbCheckVehicleCar selectOne(SelectStatementProvider selectStatement);

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    @SelectProvider(type=SqlProviderAdapter.class, method="select")
    @Results(id="TbCheckVehicleCarResult", value = {
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="organ_id", property="organId", jdbcType=JdbcType.BIGINT),
        @Result(column="area_id", property="areaId", jdbcType=JdbcType.BIGINT),
        @Result(column="road_id", property="roadId", jdbcType=JdbcType.BIGINT),
        @Result(column="plate_num", property="plateNum", jdbcType=JdbcType.VARCHAR),
        @Result(column="machine_score", property="machineScore", jdbcType=JdbcType.REAL),
        @Result(column="fix_tangs", property="fixTangs", jdbcType=JdbcType.INTEGER),
        @Result(column="real_tangs", property="realTangs", jdbcType=JdbcType.INTEGER),
        @Result(column="fix_mileage", property="fixMileage", jdbcType=JdbcType.REAL),
        @Result(column="real_mileage", property="realMileage", jdbcType=JdbcType.REAL),
        @Result(column="oil", property="oil", jdbcType=JdbcType.REAL),
        @Result(column="speed", property="speed", jdbcType=JdbcType.REAL),
        @Result(column="out_area", property="outArea", jdbcType=JdbcType.INTEGER),
        @Result(column="out_line", property="outLine", jdbcType=JdbcType.INTEGER),
        @Result(column="out_speed", property="outSpeed", jdbcType=JdbcType.INTEGER),
        @Result(column="empty_action", property="emptyAction", jdbcType=JdbcType.INTEGER),
        @Result(column="out_oil", property="outOil", jdbcType=JdbcType.INTEGER),
        @Result(column="out_stop", property="outStop", jdbcType=JdbcType.INTEGER),
        @Result(column="danger_action", property="dangerAction", jdbcType=JdbcType.INTEGER),
        @Result(column="and_score", property="andScore", jdbcType=JdbcType.REAL),
        @Result(column="sub_score", property="subScore", jdbcType=JdbcType.REAL),
        @Result(column="input_time", property="inputTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<TbCheckVehicleCar> selectMany(SelectStatementProvider selectStatement);

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    @UpdateProvider(type=SqlProviderAdapter.class, method="update")
    int update(UpdateStatementProvider updateStatement);

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    default QueryExpressionDSL<MyBatis3SelectModelAdapter<Long>> countByExample() {
        return SelectDSL.selectWithMapper(this::count, SqlBuilder.count())
                .from(tbCheckVehicleCar);
    }

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    default DeleteDSL<MyBatis3DeleteModelAdapter<Integer>> deleteByExample() {
        return DeleteDSL.deleteFromWithMapper(this::delete, tbCheckVehicleCar);
    }

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    default int deleteByPrimaryKey(Long id_) {
        return DeleteDSL.deleteFromWithMapper(this::delete, tbCheckVehicleCar)
                .where(id, isEqualTo(id_))
                .build()
                .execute();
    }

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    default int insert(TbCheckVehicleCar record) {
        return insert(SqlBuilder.insert(record)
                .into(tbCheckVehicleCar)
                .map(organId).toProperty("organId")
                .map(areaId).toProperty("areaId")
                .map(roadId).toProperty("roadId")
                .map(plateNum).toProperty("plateNum")
                .map(machineScore).toProperty("machineScore")
                .map(fixTangs).toProperty("fixTangs")
                .map(realTangs).toProperty("realTangs")
                .map(fixMileage).toProperty("fixMileage")
                .map(realMileage).toProperty("realMileage")
                .map(oil).toProperty("oil")
                .map(speed).toProperty("speed")
                .map(outArea).toProperty("outArea")
                .map(outLine).toProperty("outLine")
                .map(outSpeed).toProperty("outSpeed")
                .map(emptyAction).toProperty("emptyAction")
                .map(outOil).toProperty("outOil")
                .map(outStop).toProperty("outStop")
                .map(dangerAction).toProperty("dangerAction")
                .map(andScore).toProperty("andScore")
                .map(subScore).toProperty("subScore")
                .map(inputTime).toProperty("inputTime")
                .build()
                .render(RenderingStrategy.MYBATIS3));
    }

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    default int insertSelective(TbCheckVehicleCar record) {
        return insert(SqlBuilder.insert(record)
                .into(tbCheckVehicleCar)
                .map(organId).toPropertyWhenPresent("organId", record::getOrganId)
                .map(areaId).toPropertyWhenPresent("areaId", record::getAreaId)
                .map(roadId).toPropertyWhenPresent("roadId", record::getRoadId)
                .map(plateNum).toPropertyWhenPresent("plateNum", record::getPlateNum)
                .map(machineScore).toPropertyWhenPresent("machineScore", record::getMachineScore)
                .map(fixTangs).toPropertyWhenPresent("fixTangs", record::getFixTangs)
                .map(realTangs).toPropertyWhenPresent("realTangs", record::getRealTangs)
                .map(fixMileage).toPropertyWhenPresent("fixMileage", record::getFixMileage)
                .map(realMileage).toPropertyWhenPresent("realMileage", record::getRealMileage)
                .map(oil).toPropertyWhenPresent("oil", record::getOil)
                .map(speed).toPropertyWhenPresent("speed", record::getSpeed)
                .map(outArea).toPropertyWhenPresent("outArea", record::getOutArea)
                .map(outLine).toPropertyWhenPresent("outLine", record::getOutLine)
                .map(outSpeed).toPropertyWhenPresent("outSpeed", record::getOutSpeed)
                .map(emptyAction).toPropertyWhenPresent("emptyAction", record::getEmptyAction)
                .map(outOil).toPropertyWhenPresent("outOil", record::getOutOil)
                .map(outStop).toPropertyWhenPresent("outStop", record::getOutStop)
                .map(dangerAction).toPropertyWhenPresent("dangerAction", record::getDangerAction)
                .map(andScore).toPropertyWhenPresent("andScore", record::getAndScore)
                .map(subScore).toPropertyWhenPresent("subScore", record::getSubScore)
                .map(inputTime).toPropertyWhenPresent("inputTime", record::getInputTime)
                .build()
                .render(RenderingStrategy.MYBATIS3));
    }

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<TbCheckVehicleCar>>> selectByExample() {
        return SelectDSL.selectWithMapper(this::selectMany, id, organId, areaId, roadId, plateNum, machineScore, fixTangs, realTangs, fixMileage, realMileage, oil, speed, outArea, outLine, outSpeed, emptyAction, outOil, outStop, dangerAction, andScore, subScore, inputTime)
                .from(tbCheckVehicleCar);
    }

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    default QueryExpressionDSL<MyBatis3SelectModelAdapter<List<TbCheckVehicleCar>>> selectDistinctByExample() {
        return SelectDSL.selectDistinctWithMapper(this::selectMany, id, organId, areaId, roadId, plateNum, machineScore, fixTangs, realTangs, fixMileage, realMileage, oil, speed, outArea, outLine, outSpeed, emptyAction, outOil, outStop, dangerAction, andScore, subScore, inputTime)
                .from(tbCheckVehicleCar);
    }

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    default TbCheckVehicleCar selectByPrimaryKey(Long id_) {
        return SelectDSL.selectWithMapper(this::selectOne, id, organId, areaId, roadId, plateNum, machineScore, fixTangs, realTangs, fixMileage, realMileage, oil, speed, outArea, outLine, outSpeed, emptyAction, outOil, outStop, dangerAction, andScore, subScore, inputTime)
                .from(tbCheckVehicleCar)
                .where(id, isEqualTo(id_))
                .build()
                .execute();
    }

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExample(TbCheckVehicleCar record) {
        return UpdateDSL.updateWithMapper(this::update, tbCheckVehicleCar)
                .set(organId).equalTo(record::getOrganId)
                .set(areaId).equalTo(record::getAreaId)
                .set(roadId).equalTo(record::getRoadId)
                .set(plateNum).equalTo(record::getPlateNum)
                .set(machineScore).equalTo(record::getMachineScore)
                .set(fixTangs).equalTo(record::getFixTangs)
                .set(realTangs).equalTo(record::getRealTangs)
                .set(fixMileage).equalTo(record::getFixMileage)
                .set(realMileage).equalTo(record::getRealMileage)
                .set(oil).equalTo(record::getOil)
                .set(speed).equalTo(record::getSpeed)
                .set(outArea).equalTo(record::getOutArea)
                .set(outLine).equalTo(record::getOutLine)
                .set(outSpeed).equalTo(record::getOutSpeed)
                .set(emptyAction).equalTo(record::getEmptyAction)
                .set(outOil).equalTo(record::getOutOil)
                .set(outStop).equalTo(record::getOutStop)
                .set(dangerAction).equalTo(record::getDangerAction)
                .set(andScore).equalTo(record::getAndScore)
                .set(subScore).equalTo(record::getSubScore)
                .set(inputTime).equalTo(record::getInputTime);
    }

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    default UpdateDSL<MyBatis3UpdateModelAdapter<Integer>> updateByExampleSelective(TbCheckVehicleCar record) {
        return UpdateDSL.updateWithMapper(this::update, tbCheckVehicleCar)
                .set(organId).equalToWhenPresent(record::getOrganId)
                .set(areaId).equalToWhenPresent(record::getAreaId)
                .set(roadId).equalToWhenPresent(record::getRoadId)
                .set(plateNum).equalToWhenPresent(record::getPlateNum)
                .set(machineScore).equalToWhenPresent(record::getMachineScore)
                .set(fixTangs).equalToWhenPresent(record::getFixTangs)
                .set(realTangs).equalToWhenPresent(record::getRealTangs)
                .set(fixMileage).equalToWhenPresent(record::getFixMileage)
                .set(realMileage).equalToWhenPresent(record::getRealMileage)
                .set(oil).equalToWhenPresent(record::getOil)
                .set(speed).equalToWhenPresent(record::getSpeed)
                .set(outArea).equalToWhenPresent(record::getOutArea)
                .set(outLine).equalToWhenPresent(record::getOutLine)
                .set(outSpeed).equalToWhenPresent(record::getOutSpeed)
                .set(emptyAction).equalToWhenPresent(record::getEmptyAction)
                .set(outOil).equalToWhenPresent(record::getOutOil)
                .set(outStop).equalToWhenPresent(record::getOutStop)
                .set(dangerAction).equalToWhenPresent(record::getDangerAction)
                .set(andScore).equalToWhenPresent(record::getAndScore)
                .set(subScore).equalToWhenPresent(record::getSubScore)
                .set(inputTime).equalToWhenPresent(record::getInputTime);
    }

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    default int updateByPrimaryKey(TbCheckVehicleCar record) {
        return UpdateDSL.updateWithMapper(this::update, tbCheckVehicleCar)
                .set(organId).equalTo(record::getOrganId)
                .set(areaId).equalTo(record::getAreaId)
                .set(roadId).equalTo(record::getRoadId)
                .set(plateNum).equalTo(record::getPlateNum)
                .set(machineScore).equalTo(record::getMachineScore)
                .set(fixTangs).equalTo(record::getFixTangs)
                .set(realTangs).equalTo(record::getRealTangs)
                .set(fixMileage).equalTo(record::getFixMileage)
                .set(realMileage).equalTo(record::getRealMileage)
                .set(oil).equalTo(record::getOil)
                .set(speed).equalTo(record::getSpeed)
                .set(outArea).equalTo(record::getOutArea)
                .set(outLine).equalTo(record::getOutLine)
                .set(outSpeed).equalTo(record::getOutSpeed)
                .set(emptyAction).equalTo(record::getEmptyAction)
                .set(outOil).equalTo(record::getOutOil)
                .set(outStop).equalTo(record::getOutStop)
                .set(dangerAction).equalTo(record::getDangerAction)
                .set(andScore).equalTo(record::getAndScore)
                .set(subScore).equalTo(record::getSubScore)
                .set(inputTime).equalTo(record::getInputTime)
                .where(id, isEqualTo(record::getId))
                .build()
                .execute();
    }

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    default int updateByPrimaryKeySelective(TbCheckVehicleCar record) {
        return UpdateDSL.updateWithMapper(this::update, tbCheckVehicleCar)
                .set(organId).equalToWhenPresent(record::getOrganId)
                .set(areaId).equalToWhenPresent(record::getAreaId)
                .set(roadId).equalToWhenPresent(record::getRoadId)
                .set(plateNum).equalToWhenPresent(record::getPlateNum)
                .set(machineScore).equalToWhenPresent(record::getMachineScore)
                .set(fixTangs).equalToWhenPresent(record::getFixTangs)
                .set(realTangs).equalToWhenPresent(record::getRealTangs)
                .set(fixMileage).equalToWhenPresent(record::getFixMileage)
                .set(realMileage).equalToWhenPresent(record::getRealMileage)
                .set(oil).equalToWhenPresent(record::getOil)
                .set(speed).equalToWhenPresent(record::getSpeed)
                .set(outArea).equalToWhenPresent(record::getOutArea)
                .set(outLine).equalToWhenPresent(record::getOutLine)
                .set(outSpeed).equalToWhenPresent(record::getOutSpeed)
                .set(emptyAction).equalToWhenPresent(record::getEmptyAction)
                .set(outOil).equalToWhenPresent(record::getOutOil)
                .set(outStop).equalToWhenPresent(record::getOutStop)
                .set(dangerAction).equalToWhenPresent(record::getDangerAction)
                .set(andScore).equalToWhenPresent(record::getAndScore)
                .set(subScore).equalToWhenPresent(record::getSubScore)
                .set(inputTime).equalToWhenPresent(record::getInputTime)
                .where(id, isEqualTo(record::getId))
                .build()
                .execute();
    }
}